<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // toString()  undefined和null无法转换

      // Number 转化为字符串
      // var a = 100
      // var b = a.toString()
      // console.log(a, b) // 100,'100'

      // undefined 转化为字符串
      // var a = undefined
      // var b = a.toString()
      // console.log(a, b) // 无法转换

      // boolean 转化为字符串
      var a = false
      var b = a.toString()
      console.log(a, b) //false,'false'

      // null 转化为字符串
      // var a = null
      // var b = a.toString()
      // console.log(a, b) //无法转换
    </script>
  </body>
</html>
